package org.tio.core.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author tanyaowu 
 * 2017年4月26日 上午11:23:41
 */
public class DebugUtils
{
	private static Logger log = LoggerFactory.getLogger(DebugUtils.class);

	/**
	 * 
	 * @author: tanyaowu
	 */
	public DebugUtils()
	{
	}

	public static void printCost(CostIntf cost, String msg)
	{
		long start = System.currentTimeMillis();
		cost.action();
		long end = System.currentTimeMillis();
		long iv = end - start;
		log.error(msg + ", 耗时 " + iv + "ms");
	}

	/**
	 * @param args
	 * @author: tanyaowu
	 */
	public static void main(String[] args)
	{

	}

	public static interface CostIntf
	{
		public void action();
	}
}
